// custom-tab-bar/index.js
Component({

  /**
   * 组件的属性列表
   */
  properties: {

  },

  /**
   * 组件的初始数据
   */
  data: {
    selected: 0,
    selectedColor: "#f5a97f",
    color: "#cad3f5",
    list: [
      {
        "iconPath": "/images/yhy/posts_normal.png",
        "selectedIconPath": "/images/yhy/posts_selected.png",
        "pagePath": "/pages/posts/posts",
        "text": "动态"
      },
      {
        "iconPath": "/images/yhy/map_normal.png",
        "selectedIconPath": "/images/yhy/map_selected.png",
        "pagePath": "/pages/index/index",
        "text": "地图"
      },
      {
        "iconPath": "/images/yhy/user_normal.png",
        "selectedIconPath": "/images/yhy/user_selected.png",
        "pagePath": "/pages/user/user",
        "text": "我的"
      }
    ]
  },

  /**
   * 组件的方法列表
   */
  methods: {
    handleClick(e) {
      let path = e.currentTarget.dataset.path;
      wx.switchTab({ url: path })
    }
  }
})